import React, { Component } from 'react'
import { connect } from 'react-redux'
import { getUserList } from '../../redux/action'
import UserList from '../../compoments/user-list/userList'

class JobSeeker extends Component{
    componentDidMount() {
        let { userType } = this.props.user
        console.log(userType)
        userType =  userType === 'boss' ? 'jobSeeker': 'boss'
        this.props.getUserList(userType)
    }
    render() {
        // console.log(this.props.user.userType,this.props.userList)
        return(
            <UserList userList={ this.props.userList }/>
        )
    }
}
export default connect(
    state=>({ user:state.user, userList:state.userList }),
    { getUserList }
)(JobSeeker)